package com.teamone.monopoly.domain;



public class Player {
	private Board board;
	private Square currSquare;
	private Die die1;
	private Die die2;
	float netWorth = MGame.INITIAL_PLAYER_CASH;
	
	
	public Player(Board board, Die die1, Die die2) {
		this.board = board;
		this.die1=die1;
		this.die2=die2;
	}	

	public Square getCurrentSquare() {
		return currSquare;
	}
	
	private void rollDice() {
		die1.roll();
		die2.roll();
	}
	
	public void takeTurn() {
		rollDice();
		currSquare = board.getSquare(currSquare, getDiceTotal());
	}
	
	public int getDiceTotal() {
		return die1.getFaceValue() + die2.getFaceValue();
	}

	public float getNetWorth() {
		return netWorth;
	}

	public void addCash(float amount) {
		netWorth += amount;
	}

	public void subCash(float amount) {
		netWorth -= amount;
	}

	public void setPosition(Square square) {
		this.currSquare = square;
	}
	
}
